﻿namespace Hourglass.Qrobot.Http
{
    public static class HttpEnumExtension
    {
        public static string ToCString(this HttpRequestHandler.HttpMethod method)
        {
            switch (method)
            {
                case HttpRequestHandler.HttpMethod.Post:
                    return "post";
                default:
                    return "get";
            }
        }

        public static string ToCString(this HttpRequestHandler.HttpConnection connection)
        {
            switch (connection)
            {
                case HttpRequestHandler.HttpConnection.Close:
                    return "close";
                default:
                    return "keep-alive";
            }
        }

        public static string ToCString(this HttpRequestHandler.HttpProtocol protocol)
        {
            switch (protocol)
            {
                case HttpRequestHandler.HttpProtocol.Https:
                    return "https://";
                default:
                    return "http://";
            }
        }
    }
}
